using System;
using System.ComponentModel;
namespace LiveSequence.Common.Domain
{
   [Serializable]
    public class MethodCallInfo : ICloneable
    {
        public MethodCallInfo()
        {
          Visible = true;
          Notes = string.Empty;
          Condition = string.Empty;
        }

        [Category("Control Flow")]
        [ReadOnly(true)]
        public string StartMethod { get; set; }

        [Category("Control Flow")]
        [ReadOnly(true)]
        public string TypeName { get; set; }

        [Category("Control Flow")]
        [ReadOnly(true)]
        public string MethodName { get; set; }

        [Category("Control Flow")]
        [ReadOnly(true)]
        public string MethodCallName { get; set; }

        [Category("Control Flow")]
        [ReadOnly(true)]
        public string MethodCallType { get; set; }

        [Category("Control Flow")]
        [ReadOnly(true)]
        public string MethodCallNamespace { get; set; }

        [Category("Control Flow")]
        [ReadOnly(true)]
        public string TargetMethodAssembly { get; set; }

        public override string ToString()
        {
            string sb = string.Format("MethodCallInfo :: StartMethod:{0} TypeName: {1}, MethodName: {2}, MethodCallType: {3}, MethodCallName: {4}, TargetMethodAssembly:{5}",
                                      this.StartMethod, this.TypeName, this.MethodName, this.MethodCallType, this.MethodCallName, this.TargetMethodAssembly);

            return sb;
        }

        [Category("Info")]
        [ReadOnly(true)]
        public bool Visible { get; set; }

        [Category("Info")]
        public string Notes { get; set; }

        [Category("Info")]
        public string Condition { get; set; }

        #region ICloneable Members

        public object Clone()
        {
          MethodCallInfo result = new MethodCallInfo();
          result.MethodCallName = this.MethodCallName;
          result.Condition = this.Condition;
          result.MethodCallNamespace = this.MethodCallNamespace;
          result.MethodCallType = this.MethodCallType;
          result.MethodName = this.MethodName;
          result.Notes = this.Notes;
          result.StartMethod = this.StartMethod;
          result.TargetMethodAssembly = this.TargetMethodAssembly;
          result.TypeName = this.TypeName;
          result.Visible = this.Visible;
          return result;
        }

        #endregion
    }
}